#import <UIKit/UIKit.h>

/**
 * An SFUConnectionDelegate is a protocol for a delegate that handles
 * connection events with an SFU website.
 *
 * @author      James Lin
 * @version     0.5.0
 * @since       0.5.0
 */
@protocol SFUConnectionDelegate <NSObject>

/**
 * Handle a failed connection event to an SFU website.
 *
 * MUST be implemented.
 *
 * @param theConnection  the connection that just failed
 */
- (void)connectionDidFail:(NSURLConnection*)theConnection;

/**
 * Handle a finished connection event to an SFU website.
 *
 * MUST be implemented.
 *
 * @param theConnection  the connection that just finished
 * @param results        an object of the results (can be nil)
 */
- (void)connectionDidFinish:(NSURLConnection*)theConnection 
					results:(id)results;

@optional

/**
 * Handle a received connection response event to an SFU website.
 *
 * Implementation is optional.
 *
 * @param theConnection  the connection that just responded
 * @param response       the response from the connection
 */
- (void)connection:(NSURLConnection*)theConnection
		didRespond:(NSURLResponse*)response;

/**
 * Handle a received data event to an SFU website.
 *
 * Implementation is optional.
 *
 * @param theConnection  the connection that just finished
 * @param data           the partial data received from the connection
 */
- (void)connection:(NSURLConnection*)theConnection didReceiveData:(NSData*)data;

@end
